In the world of market price prediction, price prediction plays an important role in terms of providing investors with an opportunity to reduce risk while making a profit. A successful prediction model has the potential to have a significant impact on industry. For prediction, researchers use a variety of methods. We used two recurrent neural network models in our research: long short term memory and bidirectional long short term memory network model. This model can assist in determining the first accurate stock price with high accuracy.
Introduction
I. INTRODUCTION
In a given stock market of a country, there may be many sites (stock exchanges) for buying and selling; in simple combinations of exchanges, it is referred to as a stock market. The stock market is critical in a free democratic economy because it allows every investor to participate. Stock can be trade only after listing on market through IPO. Anyone who wants to trade must have a Demat account with one of our affiliated partners. When dealing with massive datasets, recurrent neural networks (RNN) are a good choice for forecasting stock prices. When the market is volatile, certain patterns emerge that may be discovered by developing learning models utilising machine learning, deep learning, and other techniques. This model may be trained further to find the predicted price of a stock, which will assist individuals in avoiding dangers. Forecasting is accomplished by the use of recurrent neural network techniques such as LSTM and BI-LSTM, which are trained on historical data from a diverse set of stocks. In this study, we examined the performances of the LSTM and BI-LSTM approaches in terms of how they produce results for certain stocks in order to identify the optimal algorithm with high accuracy.
II. LITERATURE SURVEY
In paper [1] M Umer Ghania, M Awaisa and Muhammad Muzammulathe main objective is to predict future stock market comfortably so the common people can participate in the growth of nation easily by comparing the growth of market and predicted growth of market.They had used 3 month moving average for accurate prediction of dataset.They also used linear regression which is best for separable data.This paper also describes
In paper [2] Mehar Vijha , Deeksha Chandolab, Vinay Anand Tikkiwalb, Arun Kumarc have largely focuses on closing price of particular stock in the stock market. They had used ANN as its good method for predicting next day closing price of stock and also good for comparative analysis.Random Forest technique is also implemented as it is comfortable with comparative analysis.
In paper [3] ,V Kranthi Sai Reddy they had collected the data from different global financial markets using machine learning for forecasting index stocks.They mostly focused on SVMtechnique as they have a large dataset to train.
In paper[4] Faisal Momin, Sunny Patel, Kuldeep Shinde, Prof. A. C. Taska system predicts stock price using a back propagation neural network algorithm and optimises this using gradient descent on stock price.This paper also focuses largely on data preprocessing.
In paper [5] Raghav Nandakumar, Uttam Raj K R, Vishal R, Y V Lokeswari ,LSTMwhich is one of the best methods to handle noise and continuous value.Here the more the data the better will be performance of model and also accuracy is also good.
In paper[6], Huicheng Liu used a Attention-based LSTM model(At-LSTM) to predict the directional movements of S & P 500 companies stock price using financial news titles. Financial news motivates people to buy or sell thus making the prediction quite predictable
III. METHODOLOGY
A. LSTM(Long Short Term Memory)
LSTM(Long Short Term Memory) is the upgraded version of RNN(Recurrent Neural Network).It has the strength to learn long-term dependencies that were not possible in RNN. LSTM is designed to solve long-term dependency problems. It can remember and forget desired information according to need.
It runs on model named cell states which have three dependencies which are as follows:After the previous time step, the information is stored in memory. Similar to the previous cell output state.New information must be stored in the memory.
B. BiLSTM(Bidirectional Long Short Memory)
BiLSTM (Bidirectional Long Short Memory) refers to RNN that runs in both directions, such as forward as well as backward. In this, your input can run from past to future as well as from future to past. BiLSTM increases the availability of information to a particular state. These types of networks are widely used for text classification and forecasting things.
IV. IMPLEMENTATION
To begin, data is gathered from various sources on the internet, including sites such as Kaggle and Yahoo Finance. These data include information about a specific stock, such as its open high, open low, closing, date, and volume. This dataset is in numerical format, and the file extension is CSV. The dataset is then normalised for further use, with a min-max max scaler used to fit the data set to the process line. After the data has been normalised, it is taken for preprocessing, where the dataset is split so that the models can use it. The dataset is designed for training because it is a critical component of the process. The dataset is crafted for training because it is a critical component of the process. The data set we use can be modified to meet the needs of the user, whether he has 30 days of stock movement, 3 months, or even a year of movement. To improve the model's accuracy, we must run it through several simulation models. However, such a process requires more time and costs more money. However, we require a more precise estimation that is not time-consuming. Now we must put both the LSTM and BiLSTM models to the test.Lstm has three major stages: cell state, hidden state (where previous output is stored), and current step (where current time input is stored). To control the flow of data, LSTM employs gates. Our data first goes to a state where it decides on useful data for the next process, after which it will learn a gate where it will combine existing short-term memory and the data input, and after applying its mathematical operations, it learns information. Then it enters the forget state, which causes unnecessary information to be released. Then there's the remembering and using a gate.Remember a gate is the result of combining the outputs of the learn and forget gates. We get our new short-term memory from the use gate. BiLSTM is nothing more than two runs that were combined to form a new network that can perform forward and backward operations at any time. The dataset we enter moves in two directions: from the past to the future and from the future to the past. In any given situation, the Bilstm model performs well.
V. RESULT ANALYSIS
STOCK NAME
LSTM
BI LSTM
ACCURACY
ERROR
ACCURACY
ERROR
AMD
95.3
0.00601
96.7075
0.00303
FB
95.59
0.00490
87.9869
0.00284
TSLA
95.19
0.00794
82.7913
0.00808
TWTR
96.57
0.00289
88.5779
0.00715
MONDY
95.42
0.00514
95.2061
0.00405
Table 1. Result Comparison
Here is a comparison of the results of two deep learning models, LSTM and BiLSTM. When comparing, three factors are taken into account: time, accuracy, and error. The data set used for comparison consists of 30 days of each stock. We used more than 50 stocks to train our model, and we trained it for more than 45 days to improve the model's training.The average accuracy for the LSTM model is 95.90, while the average accuracy for the BILSTM model is 93.30, indicating that the LSTM model is far superior to the BILSTM model in terms of accuracy.Furthermore, the time required for the Lstm model is greater than that required for the bi lstm.The average time required for Lstm is 4.2 and for BiLstm is 3.5, but this is irrelevant if the prediction is correct.
Conclusion
According to the findings of our research, the technology we use today is far more advanced in terms of providing a solution, and technologies such as deep learning are assisting people in revolutionising the traditional method. It is clear that the use of deep learning-based RNN methods is assisting in making stock price prediction even better than other modes. Lstm and bi lstm are both self-sufficient in terms of prediction, but the study shows that LSTM is superior in terms of accuracy. The LSTM Model can be further customised based on the user\'s preferences. In many cases, Lstm is far superior in terms of providing a solution.We intend to create a one-stop for analysts and traders in the future.
References
[1] MUmerGhania , M Awaisa and Muhammad Muzammula \"Stock Market Prediction Using Machine Learning(ML) Algorithms\", 2019
[2] Mehar Vijha , Deeksha Chandolab, Vinay Anand Tikkiwalb, Arun Kumarc \"Stock Closing Price Prediction using Machine Learning Techniques\", 2019
[3] V Kranthi Sai Reddy \"Stock Market Prediction Using Machine Learning\", 2018
[4] Faisal Momin,Sunny Patel,Kuldeep Shinde,Prof.A.C.Taskar \"Stock market prediction using machine learning approach\", 2019
[5] Raghav Nandakumar, Uttam Raj K R, Vishal R, Y V Lokeswar \"Stock Price Prediction Using Long Short Memory\", 2018
[6] Huicheng Liu \"Leveraging Financial News for Stock Trend Prediction with Attention-Based Recurrent Neural Network\",2018